package vip.bblog.controller

import lombok.extern.slf4j.Slf4j
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.{GetMapping, RestController}
import vip.bblog.service.UserService

@RestController
@Slf4j
class ScalaController @Autowired()(val userService: UserService) {

  @GetMapping(value = {
    Array("/scala")
  })
  def scalaIndex(): String = {
    val username = userService.selectByUserName("test")
    "hello，i am from scala, user is " + username
  }

}
